<#include "../../base/basic-page.ftl">
<#include "../../common/table.ftl">
<#include "../../common/modal.ftl">
<#include "../../common/form.ftl">
<@page_head>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.5/angular.min.js"></script>
</@page_head>
<#assign records = pageData.records>
<@page_body page_title="分类管理" side_active="/admin/system/menu">
    <div class="main-content container-fluid">
        <div class="row">
            <!--Responsive table-->
            <div class="col-sm-12">
                <@table_wrap "分类列表">
                <@table_tools>
                    <button class="btn btn-space btn-primary"
                            onclick="location.href='/user/goods/category/create'"
                    >
                        新增分类
                    </button>
                    <button class="btn btn-space btn-danger">
                        删除分类
                    </button>
                </@table_tools>
                <@table extra="table-striped table-hover">
                    <@table_head>
                        <th style="width:5%;">
                            <@custom_control>
                            </@custom_control>
                        </th>
                        <th style="width:15%;">分类名称</th>
                        <th style="width:10%;">分类描述</th>
                        <th style="width:10%;">分类链接</th>
                        <th style="width:5%;" class="number">排序标识</th>
                        <th style="width:10%;">创建时间</th>
                        <th style="width:35%;">操作</th>
                    </@table_head>
                    <@table_body>
                    <#list records as item>
                        <tr>
                            <td>
                                <@custom_control>
                                </@custom_control>
                            </td>
                            <td>
                                ${item.name}
                            </td>
                            <td>
                                无
                            </td>
                            <td>
                                <a href="/category/${item.id}" target="_blank">
                                http://pay.esiran.com/category/${item.id}
                                </a>
                            </td>
                            <td class="number">${item.orders}</td>
                            <td>
                            ${item.createTime?string['yyyy-MM-dd HH:mm:ss']}
                            </td>
                            <td>
                                <button class="btn btn-rounded btn-space btn-success"
                                        onclick="location.href='../goods/category/${item.id}'"
                                >
                                    <i class="icon mdi mdi-border-color"></i>
                                    编辑
                                </button>
                                <form class="form-inline"
                                      action="/user/goods/category/del"
                                      method="post">
                                    <input type="hidden" name="id" value="${item.id}">
                                    <button class="btn btn-rounded btn-space btn-danger del-group"
                                            type="submit"
                                    >
                                        <i class="icon mdi mdi-delete"></i>
                                        删除
                                    </button>
                                </form>
                            </td>
                        </tr>
                    </#list>
                    </@table_body>
                </@table>
                <@table_footer_ex status="当前显示第&nbsp;${(pageData.current)!'0'}&nbsp页。一共&nbsp;${(pageData.totalPage)!'0'}&nbsp;页">
                    <ng-light-pagination current="${pageData.current}" total="${pageData.total}" size="${pageData.size}">
                    </ng-light-pagination>
                </@table_footer_ex>
                </@table_wrap>
            </div>
        </div>
    </div>
</@page_body>
<@page_foot>
<script src="/static/lib/parsley/parsley.min.js" type="text/javascript"></script>
<script src="/static/js/ng-light-pagination.js?v=${sysUtil.now()}"></script>
<script type="text/javascript">
    const app = angular.module('s7buy-admin',['ngLightPagination']);
    $(document).ready(function(){
        //initialize the javascript
        var cli = new S7BuyCli();
        cli.init();
        // cli.initGoodsGroup();
    });
</script>
</@page_foot>